# Maintainer: Orhun Parmaksız <orhun@archlinux.org>
# Contributor: Morteza NourelahiAlamdari <m@0t1.me>

pkgname=binocle
pkgver=0.3.1
pkgrel=1
pkgdesc="A graphical tool to visualize binary data"
arch=('loong64' 'x86_64')
url="https://github.com/sharkdp/binocle"
license=('MIT' 'Apache')
depends=('gcc-libs')
makedepends=('rust')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha512sums=('da4ba072bb47c9f3e61379d2064858124f664e5249b2255c758206b51cbc143ee1ed9c8cef8118b864a218e40a3a7e607976175392ed99e978c6a21a37124904')

prepare() {
  cd "$pkgname-$pkgver"
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd "$pkgname-$pkgver"
  cargo build --release --frozen
}

check() {
  cd "$pkgname-$pkgver"
  cargo test --frozen
}

package() {
  cd "$pkgname-$pkgver"
  install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
  install -Dm 644 LICENSE-MIT -t "$pkgdir/usr/share/licenses/$pkgname"
}

# vim: ts=2 sw=2 et:
